<?php

	class Video_model extends CI_Model {

		protected $__tbname = 'video';
		protected $__dbconf = 'default';

		var $id;	//int(11) unsigned	Primary Key	Auto Increment	NOT NULL
		var $title;	//varchar(255)			NOT NULL
		var $video;	//varchar(255)			NULL
		var $embed_code;	//text			NULL
		var $content;	//text			NULL
		var $author;	//int(11) unsigned			NOT NULL
		var $id_provider;	//int(11) unsigned			NOT NULL
		var $image;	//varchar(255)			NULL
		var $categories;	//varchar(255)			NULL
		var $tags;	//varchar(255)			NULL
		var $type;	//varchar(64)			NULL
		var $id_video;	//varchar(64)			NULL
		var $published_date;	//datetime			NULL
		var $created_date = CURRENT_TIMESTAMP;	//timestamp			NOT NULL
		var $modified_date;	//datetime			NULL
		var $status = 0;	//tinyint(1)			NULL
		var $disabled = 0;	//tinyint(1)			NULL
		var $count_view = 0;	//int(11)			NULL
		var $count_comment = 0;	//int(11)			NULL
		var $featured = 0;	//tinyint(1)			NULL
		var $duration_time = 0;	//int(11)			NULL
		var $slug;	//varchar(255)			NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'int', 'null' => FALSE, 'auto_increment' => TRUE),
			'title' => array('type' => 'varchar', 'size' => 255, 'null' => FALSE),
			'video' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE),
			'embed_code' => array('type' => 'text', 'null' => TRUE),
			'content' => array('type' => 'text', 'null' => TRUE),
			'author' => array('type' => 'int', 'null' => FALSE),
			'id_provider' => array('type' => 'int', 'null' => FALSE),
			'image' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE),
			'categories' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE),
			'tags' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE),
			'type' => array('type' => 'varchar', 'size' => 64, 'null' => TRUE),
			'id_video' => array('type' => 'varchar', 'size' => 64, 'null' => TRUE),
			'published_date' => array('type' => 'datetime', 'null' => TRUE),
			'created_date' => array('type' => 'timestamp', 'null' => FALSE),
			'modified_date' => array('type' => 'datetime', 'null' => TRUE),
			'status' => array('type' => 'tinyint', 'null' => TRUE),
			'disabled' => array('type' => 'tinyint', 'null' => TRUE),
			'count_view' => array('type' => 'int', 'null' => TRUE),
			'count_comment' => array('type' => 'int', 'null' => TRUE),
			'featured' => array('type' => 'tinyint', 'null' => TRUE),
			'duration_time' => array('type' => 'int', 'null' => TRUE),
			'slug' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE)
		);

		protected $__relation = array(
			array('table' => 'video', 'foreign_key' => 'id_video')
		);
	}
